const path = require('path')
module.exports = {
  // 设置上下文路径
  publicPath: process.env.NODE_ENV === 'production' ? '/nuaa-scs-hanjs' : '',
  pluginOptions: {
    "style-resources-loader": {
      preProcessor: "less",
      patterns: [path.resolve(__dirname, "./src/assets/css/global.less")]
    }
  },
  devServer: {
    port: '8080',
    compress: true,	// 配置热更新
    open: true,
    proxy: {
      "/nuaa-scs/": {
        target: "http://localhost:8081/",
        changeOrigin: true,
        pathRewrite: {
          '^/nuaa-scs/': ''
        }
      },
      "/nuaa-scs-page/": {
        target: "http://localhost:8080/",
        changeOrigin: true,
        pathRewrite: {
          '^/nuaa-scs-page/': ''
        }
      },
    }
  }
}
